package JavaCore.multithreading;

/**
 * @author LiXingShuai
 * @ClassName ThreadDemo
 * @description: TODO
 * @date 2023年02月20日
 * @version: 1.0
 */
public class ThreadDemo {
    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        myThread.start();
//        RunnableThread runnableThread = new RunnableThread();
//        runnableThread.run();
//        Thread thread = new Thread(new Runnable() {
//            @Override
//            public void run() {
//                System.out.println("new Runnable:"+(int)(Math.random()*100));
//            }
//        });
//        thread.start();
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        myThread.interrupt();
        System.out.println("线程被中断："+myThread.currentThread().isInterrupted());;


    }
}
